<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'user.label', default: 'User')}"/>
    <title>用户：${user.fullName}</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>进件作业系统</li>
                    <li>
                        <g:link controller="bocUser" action="index1">商户柜员管理</g:link>
                    </li>
                    <li class="active">
                        <span>${this.user?.fullName}</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                用戶: ${this.user?.fullName}
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:if test="${flash.message}">
            <div class="message" role="status">${flash.message}</div>
        </g:if>
        <g:hasErrors bean="${this.user}">
            <ul class="text-danger" role="alert">
                <g:eachError bean="${this.user}" var="error">
                    <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                        <g:message error="${error}"/>
                    </li>
                </g:eachError>
            </ul>
        </g:hasErrors>
        <div class="hpanel hblue">
            <div class="panel-heading">
                用戶信息编辑
            </div>

            <div class="panel-body">
                <g:form id="${this.user?.id}" action="update1" method="PUT" class="form-horizontal">

                    <div class="form-group">
                        <label class="col-md-3 control-label">商户柜员名称:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="fullName" value="${this.user?.fullName}" id="fullName"/>
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-md-3 control-label">商户柜员手机号:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="cellphone" value="${this.user?.cellphone}" id="cellphone"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">身份证号:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="idNumber" value="${this.user?.idNumber}" id="idNumber"/>
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>

                    <g:hiddenField name="type" id="type" value="${userType?.id}"/>

                    <div class="form-group">
                        <label class="col-md-3 control-label">归属商户:</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="account" optionKey="id" optionValue="name" from="${accounts}" value="${this.user?.account?.id}" noSelection="['':'-请选择归属商户-']"/>
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-4">
                            <button class="btn btn-info" type="submit">保存</button>
                        </div>
                    </div>
                </g:form>
            </div>
        </div>
    </div>
</div>
<script>
    $(".cellphoneFormat2").focus(function () {
        $(this).val("");
        $(".hiddenCellphone").val("")
    })
    $(".cellphoneFormat2").blur(function () {
        $(".hiddenCellphone").val($(".cellphoneFormat2").val());
    });

</script>
</body>
</html>
